package com.aoxin.controller.client;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.aoxin.service.inter.client.VipRelevantService;
import com.aoxin.util.AjaxRes;
import com.aoxin.util.Const;
/**
 * VIP 相关controller
 * @author Administrator
 *
 */
@RestController
@RequestMapping("/web/vipRelevant")
public class VipRelevantController {
	
	@Autowired
	VipRelevantService vipRelevantService;
	
	/**
	 * 获取VIP 数据
	 * @param res
	 * @return
	 */
	@RequestMapping("/getVipPrice")
	public AjaxRes  getVipPrice(AjaxRes res){
		
		try {
		 Map<String,Object>	resultMap= vipRelevantService.queryVipPrice();
		 res.setSucceed(resultMap, Const.DATA_SUCCEED);
		} catch (Exception e) {
			res.setFailMsg(e.getMessage());
		}
		return res;
		
	}
	
	/**
	 *  更新VIP 标志    
	 * @param res
	 * @return    
	 */
	@RequestMapping("/insertVipSign")
	public AjaxRes  insertVipSign(AjaxRes res){
		try {
			vipRelevantService.updateUserFlag();
			res.setSucceed(Const.PURCHASE_SUCCESS);
		} catch (Exception e) {
			res.setFailMsg(e.getMessage());
		}
		return res;
		
	}
	
	
}
